<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>塌陷问题</title>
    <style>
        .father {
            width: 500px;
            height: 500px;
            background-color: red;
            /* 解决方法是改为父级标签加内边距 最优 */
            /* padding-top: 100px; */
            /* overflow: hidden; */
            border-top: 1px solid #000;
        }
        
        .son {
            width: 200px;
            height: 200px;
            background-color: pink;
            /* 在子级加顶部外边距就会产生塌陷问题 */
            margin-top: 100px;
        }
    </style>
</head>
<body>
    <div class="father">
        <div class="son">塌陷问题</div>
    </div>
</body>
</html>